3.157 \(\int \csc (e+f x) (a+b \tan ^2(e+f x))^p \, dx\)

Optimal. Leaf size=88 \[ -\frac{\sec (e+f x) \left (a+b \sec ^2(e+f x)-b\right )^p \left (\frac{b \sec ^2(e+f x)}{a-b}+1\right )^{-p} F_1\left (\frac{1}{2};1,-p;\frac{3}{2};\sec ^2(e+f x),-\frac{b \sec ^2(e+f x)}{a-b}\right )}{f} \]

[Out]

-((AppellF1[1/2, 1, -p, 3/2, Sec[e + f*x]^2, -((b*Sec[e + f*x]^2)/(a - b))]*Sec[e + f*x]*(a - b + b*Sec[e + f*
x]^2)^p)/(f*(1 + (b*Sec[e + f*x]^2)/(a - b))^p))

________________________________________________________________________________________

Rubi [A]  time = 0.0805196, antiderivative size = 88, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {3664, 430, 429} \[ -\frac{\sec (e+f x) \left (a+b \sec ^2(e+f x)-b\right )^p \left (\frac{b \sec ^2(e+f x)}{a-b}+1\right )^{-p} F_1\left (\frac{1}{2};1,-p;\frac{3}{2};\sec ^2(e+f x),-\frac{b \sec ^2(e+f x)}{a-b}\right )}{f} \]

Antiderivative was successfully verified.

[In]

Int[Csc[e + f*x]*(a + b*Tan[e + f*x]^2)^p,x]

[Out]

-((AppellF1[1/2, 1, -p, 3/2, Sec[e + f*x]^2, -((b*Sec[e + f*x]^2)/(a - b))]*Sec[e + f*x]*(a - b + b*Sec[e + f*
x]^2)^p)/(f*(1 + (b*Sec[e + f*x]^2)/(a - b))^p))

Rule 3664

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = Free
Factors[Sec[e + f*x], x]}, Dist[1/(f*ff^m), Subst[Int[((-1 + ff^2*x^2)^((m - 1)/2)*(a - b + b*ff^2*x^2)^p)/x^(
m + 1), x], x, Sec[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

Rule 430

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Dist[(a^IntPart[p]*(a + b*x^n)^F
racPart[p])/(1 + (b*x^n)/a)^FracPart[p], Int[(1 + (b*x^n)/a)^p*(c + d*x^n)^q, x], x] /; FreeQ[{a, b, c, d, n,
p, q}, x] && NeQ[b*c - a*d, 0] && NeQ[n, -1] &&  !(IntegerQ[p] || GtQ[a, 0])

Rule 429

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[a^p*c^q*x*AppellF1[1/n, -p,
 -q, 1 + 1/n, -((b*x^n)/a), -((d*x^n)/c)], x] /; FreeQ[{a, b, c, d, n, p, q}, x] && NeQ[b*c - a*d, 0] && NeQ[n
, -1] && (IntegerQ[p] || GtQ[a, 0]) && (IntegerQ[q] || GtQ[c, 0])

Rubi steps

\begin{align*} \int \csc (e+f x) \left (a+b \tan ^2(e+f x)\right )^p \, dx &=\frac{\operatorname{Subst}\left (\int \frac{\left (a-b+b x^2\right )^p}{-1+x^2} \, dx,x,\sec (e+f x)\right )}{f}\\ &=\frac{\left (\left (a-b+b \sec ^2(e+f x)\right )^p \left (1+\frac{b \sec ^2(e+f x)}{a-b}\right )^{-p}\right ) \operatorname{Subst}\left (\int \frac{\left (1+\frac{b x^2}{a-b}\right )^p}{-1+x^2} \, dx,x,\sec (e+f x)\right )}{f}\\ &=-\frac{F_1\left (\frac{1}{2};1,-p;\frac{3}{2};\sec ^2(e+f x),-\frac{b \sec ^2(e+f x)}{a-b}\right ) \sec (e+f x) \left (a-b+b \sec ^2(e+f x)\right )^p \left (1+\frac{b \sec ^2(e+f x)}{a-b}\right )^{-p}}{f}\\ \end{align*}

Mathematica [B]  time = 15.0711, size = 1215, normalized size = 13.81 \[ \frac{\csc (e+f x) \left (b \tan ^2(e+f x)+a\right )^{2 p} \left (\frac{2 F_1\left (-p-\frac{1}{2};-\frac{1}{2},-p;\frac{1}{2}-p;-\cot ^2(e+f x),-\frac{a \cot ^2(e+f x)}{b}\right ) \left (\frac{a \cot ^2(e+f x)}{b}+1\right )^{-p} \sqrt{\sec ^2(e+f x)}}{(2 p+1) \sqrt{\csc ^2(e+f x)}}-F_1\left (1;\frac{1}{2},-p;2;-\tan ^2(e+f x),-\frac{b \tan ^2(e+f x)}{a}\right ) \tan ^2(e+f x) \left (\frac{b \tan ^2(e+f x)}{a}+1\right )^{-p}\right )}{2 f \left (b p \sec ^2(e+f x) \tan (e+f x) \left (\frac{2 F_1\left (-p-\frac{1}{2};-\frac{1}{2},-p;\frac{1}{2}-p;-\cot ^2(e+f x),-\frac{a \cot ^2(e+f x)}{b}\right ) \left (\frac{a \cot ^2(e+f x)}{b}+1\right )^{-p} \sqrt{\sec ^2(e+f x)}}{(2 p+1) \sqrt{\csc ^2(e+f x)}}-F_1\left (1;\frac{1}{2},-p;2;-\tan ^2(e+f x),-\frac{b \tan ^2(e+f x)}{a}\right ) \tan ^2(e+f x) \left (\frac{b \tan ^2(e+f x)}{a}+1\right )^{-p}\right ) \left (b \tan ^2(e+f x)+a\right )^{p-1}+\frac{1}{2} \left (\frac{4 a p F_1\left (-p-\frac{1}{2};-\frac{1}{2},-p;\frac{1}{2}-p;-\cot ^2(e+f x),-\frac{a \cot ^2(e+f x)}{b}\right ) \cot (e+f x) \sqrt{\csc ^2(e+f x)} \sqrt{\sec ^2(e+f x)} \left (\frac{a \cot ^2(e+f x)}{b}+1\right )^{-p-1}}{b (2 p+1)}+\frac{2 F_1\left (-p-\frac{1}{2};-\frac{1}{2},-p;\frac{1}{2}-p;-\cot ^2(e+f x),-\frac{a \cot ^2(e+f x)}{b}\right ) \sqrt{\sec ^2(e+f x)} \tan (e+f x) \left (\frac{a \cot ^2(e+f x)}{b}+1\right )^{-p}}{(2 p+1) \sqrt{\csc ^2(e+f x)}}+\frac{2 \left (-\frac{2 a \left (-p-\frac{1}{2}\right ) p F_1\left (\frac{1}{2}-p;-\frac{1}{2},1-p;\frac{3}{2}-p;-\cot ^2(e+f x),-\frac{a \cot ^2(e+f x)}{b}\right ) \cot (e+f x) \csc ^2(e+f x)}{b \left (\frac{1}{2}-p\right )}-\frac{\left (-p-\frac{1}{2}\right ) F_1\left (\frac{1}{2}-p;\frac{1}{2},-p;\frac{3}{2}-p;-\cot ^2(e+f x),-\frac{a \cot ^2(e+f x)}{b}\right ) \cot (e+f x) \csc ^2(e+f x)}{\frac{1}{2}-p}\right ) \sqrt{\sec ^2(e+f x)} \left (\frac{a \cot ^2(e+f x)}{b}+1\right )^{-p}}{(2 p+1) \sqrt{\csc ^2(e+f x)}}+\frac{2 F_1\left (-p-\frac{1}{2};-\frac{1}{2},-p;\frac{1}{2}-p;-\cot ^2(e+f x),-\frac{a \cot ^2(e+f x)}{b}\right ) \cot (e+f x) \sqrt{\sec ^2(e+f x)} \left (\frac{a \cot ^2(e+f x)}{b}+1\right )^{-p}}{(2 p+1) \sqrt{\csc ^2(e+f x)}}+\frac{2 b p F_1\left (1;\frac{1}{2},-p;2;-\tan ^2(e+f x),-\frac{b \tan ^2(e+f x)}{a}\right ) \sec ^2(e+f x) \tan ^3(e+f x) \left (\frac{b \tan ^2(e+f x)}{a}+1\right )^{-p-1}}{a}-2 F_1\left (1;\frac{1}{2},-p;2;-\tan ^2(e+f x),-\frac{b \tan ^2(e+f x)}{a}\right ) \sec ^2(e+f x) \tan (e+f x) \left (\frac{b \tan ^2(e+f x)}{a}+1\right )^{-p}-\tan ^2(e+f x) \left (\frac{b p F_1\left (2;\frac{1}{2},1-p;3;-\tan ^2(e+f x),-\frac{b \tan ^2(e+f x)}{a}\right ) \sec ^2(e+f x) \tan (e+f x)}{a}-\frac{1}{2} F_1\left (2;\frac{3}{2},-p;3;-\tan ^2(e+f x),-\frac{b \tan ^2(e+f x)}{a}\right ) \sec ^2(e+f x) \tan (e+f x)\right ) \left (\frac{b \tan ^2(e+f x)}{a}+1\right )^{-p}\right ) \left (b \tan ^2(e+f x)+a\right )^p\right )} \]

Warning: Unable to verify antiderivative.

[In]

Integrate[Csc[e + f*x]*(a + b*Tan[e + f*x]^2)^p,x]

[Out]

(Csc[e + f*x]*(a + b*Tan[e + f*x]^2)^(2*p)*((2*AppellF1[-1/2 - p, -1/2, -p, 1/2 - p, -Cot[e + f*x]^2, -((a*Cot
[e + f*x]^2)/b)]*Sqrt[Sec[e + f*x]^2])/((1 + 2*p)*(1 + (a*Cot[e + f*x]^2)/b)^p*Sqrt[Csc[e + f*x]^2]) - (Appell
F1[1, 1/2, -p, 2, -Tan[e + f*x]^2, -((b*Tan[e + f*x]^2)/a)]*Tan[e + f*x]^2)/(1 + (b*Tan[e + f*x]^2)/a)^p))/(2*
f*(b*p*Sec[e + f*x]^2*Tan[e + f*x]*(a + b*Tan[e + f*x]^2)^(-1 + p)*((2*AppellF1[-1/2 - p, -1/2, -p, 1/2 - p, -
Cot[e + f*x]^2, -((a*Cot[e + f*x]^2)/b)]*Sqrt[Sec[e + f*x]^2])/((1 + 2*p)*(1 + (a*Cot[e + f*x]^2)/b)^p*Sqrt[Cs
c[e + f*x]^2]) - (AppellF1[1, 1/2, -p, 2, -Tan[e + f*x]^2, -((b*Tan[e + f*x]^2)/a)]*Tan[e + f*x]^2)/(1 + (b*Ta
n[e + f*x]^2)/a)^p) + ((a + b*Tan[e + f*x]^2)^p*((2*AppellF1[-1/2 - p, -1/2, -p, 1/2 - p, -Cot[e + f*x]^2, -((
a*Cot[e + f*x]^2)/b)]*Cot[e + f*x]*Sqrt[Sec[e + f*x]^2])/((1 + 2*p)*(1 + (a*Cot[e + f*x]^2)/b)^p*Sqrt[Csc[e +
f*x]^2]) + (4*a*p*AppellF1[-1/2 - p, -1/2, -p, 1/2 - p, -Cot[e + f*x]^2, -((a*Cot[e + f*x]^2)/b)]*Cot[e + f*x]
*(1 + (a*Cot[e + f*x]^2)/b)^(-1 - p)*Sqrt[Csc[e + f*x]^2]*Sqrt[Sec[e + f*x]^2])/(b*(1 + 2*p)) + (2*((-2*a*(-1/
2 - p)*p*AppellF1[1/2 - p, -1/2, 1 - p, 3/2 - p, -Cot[e + f*x]^2, -((a*Cot[e + f*x]^2)/b)]*Cot[e + f*x]*Csc[e
+ f*x]^2)/(b*(1/2 - p)) - ((-1/2 - p)*AppellF1[1/2 - p, 1/2, -p, 3/2 - p, -Cot[e + f*x]^2, -((a*Cot[e + f*x]^2
)/b)]*Cot[e + f*x]*Csc[e + f*x]^2)/(1/2 - p))*Sqrt[Sec[e + f*x]^2])/((1 + 2*p)*(1 + (a*Cot[e + f*x]^2)/b)^p*Sq
rt[Csc[e + f*x]^2]) + (2*AppellF1[-1/2 - p, -1/2, -p, 1/2 - p, -Cot[e + f*x]^2, -((a*Cot[e + f*x]^2)/b)]*Sqrt[
Sec[e + f*x]^2]*Tan[e + f*x])/((1 + 2*p)*(1 + (a*Cot[e + f*x]^2)/b)^p*Sqrt[Csc[e + f*x]^2]) + (2*b*p*AppellF1[
1, 1/2, -p, 2, -Tan[e + f*x]^2, -((b*Tan[e + f*x]^2)/a)]*Sec[e + f*x]^2*Tan[e + f*x]^3*(1 + (b*Tan[e + f*x]^2)
/a)^(-1 - p))/a - (2*AppellF1[1, 1/2, -p, 2, -Tan[e + f*x]^2, -((b*Tan[e + f*x]^2)/a)]*Sec[e + f*x]^2*Tan[e +
f*x])/(1 + (b*Tan[e + f*x]^2)/a)^p - (Tan[e + f*x]^2*((b*p*AppellF1[2, 1/2, 1 - p, 3, -Tan[e + f*x]^2, -((b*Ta
n[e + f*x]^2)/a)]*Sec[e + f*x]^2*Tan[e + f*x])/a - (AppellF1[2, 3/2, -p, 3, -Tan[e + f*x]^2, -((b*Tan[e + f*x]
^2)/a)]*Sec[e + f*x]^2*Tan[e + f*x])/2))/(1 + (b*Tan[e + f*x]^2)/a)^p))/2))

________________________________________________________________________________________

Maple [F]  time = 0.214, size = 0, normalized size = 0. \begin{align*} \int \csc \left ( fx+e \right ) \left ( a+b \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) ^{p}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(f*x+e)*(a+b*tan(f*x+e)^2)^p,x)

[Out]

int(csc(f*x+e)*(a+b*tan(f*x+e)^2)^p,x)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (b \tan \left (f x + e\right )^{2} + a\right )}^{p} \csc \left (f x + e\right )\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)*(a+b*tan(f*x+e)^2)^p,x, algorithm="maxima")

[Out]

integrate((b*tan(f*x + e)^2 + a)^p*csc(f*x + e), x)

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left ({\left (b \tan \left (f x + e\right )^{2} + a\right )}^{p} \csc \left (f x + e\right ), x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)*(a+b*tan(f*x+e)^2)^p,x, algorithm="fricas")

[Out]

integral((b*tan(f*x + e)^2 + a)^p*csc(f*x + e), x)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)*(a+b*tan(f*x+e)**2)**p,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (b \tan \left (f x + e\right )^{2} + a\right )}^{p} \csc \left (f x + e\right )\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)*(a+b*tan(f*x+e)^2)^p,x, algorithm="giac")

[Out]

integrate((b*tan(f*x + e)^2 + a)^p*csc(f*x + e), x)